package org.kabeja.parser.objects;

import org.kabeja.dxf.DXFConstants;
import org.kabeja.dxf.entity.DXFXRecord;
import org.kabeja.dxf.objects.DXFObject;
import org.kabeja.parser.DXFValue;

/**
 * @author shutao
 * @since 2022/4/28 12:27
 */
public class DXFXRecordHandler extends AbstractDXFObjectHandler {
    public static final int RECORD_TAGS = 280;
    protected DXFXRecord dxfxRecord;

    public DXFXRecordHandler() {
    }

    @Override
    public void endObject() {

    }

    @Override
    public DXFObject getDXFObject() {
        return dxfxRecord;
    }

    @Override
    public String getObjectType() {
        return DXFConstants.OBJECT_TYPE_XRECORD;
    }

    @Override
    public void parseGroup(int var1, DXFValue var2) {
        switch (var1) {
            case RECORD_TAGS:
                this.dxfxRecord.setRecordTags(var2.getIntegerValue());
                break;
            default:
                super.parseCommonGroupCode(var1, var2, this.dxfxRecord);
        }
    }

    @Override
    public void startObject() {
        this.dxfxRecord = new DXFXRecord();
    }
}
